﻿using Lf_Shop.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace Lf_Shop.service
{
    public interface IOrderService
    {
        /// <summary>
        /// 校验商品的库存
        /// </summary>
        /// <returns>够库存返回ture 不够 返回false</returns>
        bool CheckGoodStock(List<CarGoodModel> list, out string err);
        /// <summary>
        /// 扣除商品的库存
        /// </summary>
        /// <returns></returns>
        void DiffGoodStock(List<CarGoodModel> list);
        /// <summary>
        /// 创建订单 
        /// </summary>
        void CreateOrder(List<CarGoodModel> list, int userId);
        /// <summary>
        /// 返回用户的订单模型
        /// </summary>
        List<UserOrder> GetUserOrderList(int userId, int orderState, int pageIndex, int pageSize, out int total);
        /// <summary>
        /// 返回后台订单列表
        /// </summary>
        List<AdminOrder> GetAdminOrderList(int orderState, int pageIndex, int pageSize, out int total);
        /// <summary>
        /// 发货
        /// </summary>
        /// <param name="orderId"></param>
        /// <param name="shipCom"></param>
        /// <param name="shipNum"></param>
        void SendOrder(int orderId, string shipCom, string shipNum);
    }
}
